﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using YunBox2.Client.Infrastructure.ViewModels;

namespace YunBox2.Client.Infrastructure
{
	/// <summary>
	/// LoginPage.xaml 的交互逻辑
	/// </summary>
	[Export("LoginPage",typeof(LoginPage))]
	public partial class LoginPage : UserControl
	{
		public LoginPage()
		{
			this.InitializeComponent();
		}

        [Import(typeof(LoginViewModel))]
	    LoginViewModel ViewModel
	    {
            get
            {
                return (LoginViewModel) DataContext;
            }
	        set
	        {
	            DataContext = value;
	        }
	    }

        
        private void InitButton_Click(object sender, RoutedEventArgs e)
        {
            FirstRunDialog dialog = ClientContext.Current.PrismContainer.GetExportedValue<FirstRunDialog>("FirstRunDialog");
            
            dialog.ShowDialog();
           
        }

        private void passwordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            ViewModel.Password = ((PasswordBox) sender).Password;
        }

      
	}
}